#ifndef OCRWIDGET_H
#define OCRWIDGET_H
#include "screenshotswidget.h"
#include <QPixmap>
#include <QWidget>
#include <QLineEdit>
#include <QLabel>
#include <QPushButton>
#include <QTextEdit>
#include <QNetworkAccessManager>
#include <QNetworkReply>
class OcrWidget : public QWidget
{
    Q_OBJECT
private:
    ScreenshotsWidget *pScreenshotsWidget;
    QPixmap *pScreenshotPixmap;
    QTextEdit *pResultTextEdit;
    QLabel *pResultLabel;

    QLabel *pApiKeyLabel;
    QLabel *pSecretKeyLabel;

    QLineEdit *pApiKeyLineEdit;
    QLineEdit *pSecretKeyLabelLineEdit;

    QPushButton *pOcrButton;
    QPushButton *pSaveCfgButton;

    QNetworkAccessManager *pNetworkAccessManager;
    QString tokenString;
private slots:
    void AccessTokenSlot(QNetworkReply *m_rely);
    void OcrButtonClicked();
    void OcrSlot(QPixmap pixmap);
    void OcrResultSlot(QNetworkReply* reply);
    void SaveConfigSlot();
public:
    explicit OcrWidget(QWidget *parent = nullptr);
    void RefreshToken();

signals:

};

#endif // OCRWIDGET_H
